﻿using System.Collections.Generic;
using System.IO;

namespace Chevron.OrderDetails.Models
{
    public class TestCategoryCatalog : SortedDictionary<string, TestCategory>
    {
        public void LoadCatalog(string filename)
        {
            using (var sr = new StreamReader(filename))
            {
                string line;
                while ((line = sr.ReadLine()) != null)
                {
                    TestCategory cat = TestCategory.Deserialize(line);
                    Add(cat.Name, cat);
                }
            }
        }
    }
}